<?php
	include_once 'isLogin.php';
	if($group_id=='2'){
		header("location:index.php");
		exit;		
	}
	
	$table_name = "admin";
	$id=$_GET['id'];

	if($_POST['submit']){
		$arr = array('group_id'=>$_POST['group_id'],);
		$commonc->update($table_name,$arr,'id='.$id);
		echo $commonc->submitAlert('成功','admin_info.php?id='.$id);
		exit;
	}


	if($id!='' && $id!=null){
		$row=$commonc->getInfo($table_name,$id);

		//读取可选角色
		$groupc=new group();
		$admin_group=$groupc->admin_group_list();
		$smarty->assign('admin_group',$admin_group['result']);

		$smarty->assign('row',$row);
	}



	
	$smarty->display("admin_info.html");
?>